<template>
    <!-- pages/collectioncode/bindcard/status/index.wxml -->
    <view class="page">
        <view class="text-9" v-if="cardDetails.status == 1">修改申请已提交到审批部门，我们将在2个工作日内完成审批并告知审批结果，请耐心等候。</view>
        <view class="text mt-60" v-if="cardDetails.status == 1">注：修改结算卡为2个工作日内，修改成功前款项结算到原账户，修改成功后的款项结算到新账户。</view>
        <view class="text" v-if="cardDetails.status != 1">很抱歉，您的修改审核被拒绝请更换其他银行账户重新提交</view>
        <view class="btn" @tap.stop.prevent="onSub">{{ cardDetails.status == 1 ? '确定' : '重新提交' }}</view>
    </view>
</template>

<script>
// pages/collectioncode/bindcard/status/index.js
const app = getApp(); // 引入app

import _request from '../../../../utils/request.js';

const moment = require('../../../../utils/moment.min');

export default {
    data() {
        return {
            incomingInfo: null,
            // 进件对象
            cardDetails: null // 收款卡详情
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad(options) {
        const vm = this;

        _request
            .get('/box/getIncoming', {
                storeId: uni.getStorageSync('storeId')
            })
            .then((res) => {
                if (res.data.code === 200) {
                    const data = res.data.data;
                    this.setData(
                        {
                            incomingInfo: data
                        },
                        () => {
                            // 查询收款卡
                            if (data.shopId) {
                                _request
                                    .get('/box/getCardDetails', {
                                        shopId: data.shopId,
                                        status: 0
                                    })
                                    .then((res) => {
                                        if (res.data.code == 200) {
                                            vm.setData({
                                                cardDetails: res.data.data
                                            });
                                        }
                                    });
                            }
                        }
                    );
                }
            });
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide() {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload() {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh() {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom() {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage() {},
    methods: {
        // 重新提交
        onSub() {
            const { cardDetails } = this;

            if (cardDetails.status == 1) {
                uni.navigateBack({
                    delta: -1
                });
            } else {
                uni.navigateTo({
                    url: '/pages/collectioncode/bindcard/edit/index'
                });
            }
        }
    }
};
</script>
<style>
/* pages/collectioncode/bindcard/status/index.wxss */
.page {
    padding: 30rpx;
}

.text-9 {
    height: 40rpx;
    font-size: 32rpx;
    font-family: PingFang-SC-Medium, PingFang-SC;
    font-weight: 500;
    color: #999;
    line-height: 40rpx;
}

.text {
    height: 40rpx;
    font-size: 32rpx;
    font-family: PingFang-SC-Medium, PingFang-SC;
    font-weight: 500;
    line-height: 40rpx;
}
.btn {
    width: 690rpx;
    height: 90rpx;
    background: #ff8722;
    border-radius: 45rpx;
    font-size: 36rpx;
    font-family: PingFang SC;
    font-weight: 500;
    color: #f3f3f3;
    line-height: 90rpx;
    text-align: center;
    margin: 100rpx 0 0 0;
}
</style>
